package com.ruoyi.web.service;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.FoodDietPlanMapper;
import com.ruoyi.web.domain.FoodDietPlan;


/**
 * 计划Service业务层处理
 *
 * @author xian_pei
 * @date 2024-06-13
 */
@Service
public class FoodDietPlanService
{
    @Autowired
    private FoodDietPlanMapper foodDietPlanMapper;

    /**
     * 查询计划
     *
     * @param planId 计划主键
     * @return 计划
     */

    public FoodDietPlan selectFoodDietPlanByPlanId(Long planId)
    {
        return foodDietPlanMapper.selectFoodDietPlanByPlanId(planId);
    }

    /**
     * 查询计划列表
     *
     * @param foodDietPlan 计划
     * @return 计划
     */

    public List<FoodDietPlan> selectFoodDietPlanList(FoodDietPlan foodDietPlan)
    {
        return foodDietPlanMapper.selectFoodDietPlanList(foodDietPlan);
    }

    /**
     * 新增计划
     *
     * @param foodDietPlan 计划
     * @return 结果
     */

    public int insertFoodDietPlan(FoodDietPlan foodDietPlan)
    {
        foodDietPlan.setCreateTime(DateUtils.getNowDate());
        return foodDietPlanMapper.insertFoodDietPlan(foodDietPlan);
    }

    /**
     * 修改计划
     *
     * @param foodDietPlan 计划
     * @return 结果
     */

    public int updateFoodDietPlan(FoodDietPlan foodDietPlan)
    {
        return foodDietPlanMapper.updateFoodDietPlan(foodDietPlan);
    }

    /**
     * 批量删除计划
     *
     * @param planIds 需要删除的计划主键
     * @return 结果
     */

    public int deleteFoodDietPlanByPlanIds(Long[] planIds)
    {
        return foodDietPlanMapper.deleteFoodDietPlanByPlanIds(planIds);
    }

    /**
     * 删除计划信息
     *
     * @param planId 计划主键
     * @return 结果
     */

    public int deleteFoodDietPlanByPlanId(Long planId)
    {
        return foodDietPlanMapper.deleteFoodDietPlanByPlanId(planId);
    }
}
